<?php

#################################################################
#								HTML
#################################################################

	/**
	 * Main layout registed as 'layout/main'
	 * 
	 * $vars['content']
	 */

if($_CONTEXT=='HTML'){

	$_CSS_STACK->push(blg_get_site_url().'layout/main.css', TRUE);
	$_JS_STACK->push(blg_get_site_url().'layout/main.js', TRUE);		
	
	//HEADER, FOOTER, MESSAGES, PROMPT
	$header= blg_view('component/header');
	$footer= blg_view('component/footer');
	$messages= blg_view('component/messages', array('messages' => blg_msg_get_all()) );
	$prompt= blg_view('component/prompt');	
	
	$vars['content'] = '
	
	'.$messages.'
		
	'.$prompt.'
	
	<div class="blg_main_container">
		<div class="blg_main_div">
			<div class="blg_main_header_div">
				'.$header.'
			</div>
			<div class="blg_main_content_div">
				'.$vars['content'].'
			</div>
			<div class="blg_main_footer_div">
				'.$footer.'
			</div>	
		</div>
	</div>
	';
	
	if(blg_session_isset('focus_on_load_id')){
		$code="
			$('[blg_id=".blg_session_get('focus_on_load_id')."]').focus();
			$('#".blg_session_get('focus_on_load_id')."').focus();
		";
		
		$_JS_CODE->append($code, ON_DOC_READY);
	}	
	
	echo blg_view('layout/default', $vars);	
}
#################################################################
#								JS
#################################################################
elseif($_CONTEXT=='JS'){ ?>

<?php }
#################################################################
#								CSS
#################################################################
elseif($_CONTEXT=='CSS'){ ?>


/*********************** MAIN STRUCTURE ***********************/

div.blg_main_container{
	/* DO NOT EDIT */
	position: relative;
	width: 1010px;
	margin-left: -500px;
	min-height: 100%;	
	left: 50%;
	z-index: 10;
	/* DO NOT EDIT */
	
	background-image: url('<?php echo blg_get_site_url()?>_graphics/default/structure/blg_main_div_bg.png');
	background-position: center;
	background-repeat: repeat-y;	
}

div.blg_main_div{
	/* DO NOT EDIT */
	margin: 0 auto;	
	width: 1000px;
	min-height: 100%;
	/* DO NOT EDIT */	
}

div.blg_main_tools_div{
	height: 20px;	
}

div.blg_main_header_div{	
}

div.blg_main_content_div{
	/* DO NOT EDIT */
	padding-bottom: 80px; //50 + 30
	/* DO NOT EDIT */
}

div.blg_main_footer_div{
	/* DO NOT EDIT */
	height: 50px;
	width: 1000px;
	position: absolute;	
	bottom: 0;
	/* DO NOT EDIT */
}

<?php }